<?php
require('media-temple-gpu.php');
$session = false;
if (file_exists('session.dat')) {
    $session = unserialize(file_get_contents('session.dat'));
}
$mt = new MediaTempleGPUMonitor($session);
//$html = file_get_contents('grid-report.html');
//$amount = $mt->_parseGPUPage($html);
//echo $amount;
if (!$mt->isLoggedIn()) {
    echo 'perform login?';
    if (!$mt->login('', '', '')) {
        echo 'login failed!';
        exit;
    }
    
}
$session = $mt->getSession();
$fp = fopen('session.dat', 'w');
fwrite($fp, serialize($session));
fclose($fp);
echo '<h1>test</h1>';
$gpu = $mt->getCurrentGPUData(163369);
print_r($gpu);

?>